import Login from '../pages/Login';
import Home from '../pages/Home';
import Product from '../pages/Product';
import Order from '../pages/Order';
import OrderDetail from '../pages/Order/Detail';
import Error from '../pages/Error';
import AuthLayout from '../components/AuthLayout';
import Menu from '../pages/Menu';
import User from "../pages/User";
import OrderPaymentPage from "../pages/Order/Payment";
import OrderSuccessPage from "../pages/Order/Success";
import OrderToPay from "../pages/MyOrder/OrderToPay";
import OrderAfterSale from "../pages/MyOrder/OrderAfterSale";
import OrderToReceive from "../pages/MyOrder/OrderToReceive";
import AllOrders from "../pages/MyOrder/AllOrders";
import SuccessFirstPage from "../pages/Payment/first";
import SuccessSecondPage from "../pages/Payment/second";
import SuccessThirdPage from "../pages/Payment/third";
import ShoppingCar from "../pages/ShoppingCar/ShoppingCar";
import ProductCategory from "../pages/Classification/ProductCategory";
import SubCategory from "../pages/Classification/SubCategory";
import SubCategoryProduct from "../pages/Classification/SubCategoryProduct";

// 路由配置
const routesConfig = [
  { path: '/login', element: <Login /> },
  { path: '/', element: <Home /> },
  { path: '/home', element: <Home /> },
  { path: `/product/:id`, element: <Product /> },
  { path: '/order', element: <Order /> },
  { path:'/productCategory',
    element: <ProductCategory/>,
    children: [
        {path: '/productCategory/SubCategory', element: <SubCategory />},
    ]
  },
  { path: '/subCategoryProduct/:id', element:<SubCategoryProduct/>},
  { path: '/user', element: <User /> },
  { path: '/menu', element: <Menu /> },
  {
    path: '/',
    // element: <AuthLayout />,
    children: [
      { path: '/order/:id', element: <Order /> },
      { path: '/shoppingCar',element: <ShoppingCar/>},
      { path: '/order/info/:id', element: <OrderDetail /> },
      { path: '/order/pay/:id',element: <OrderPaymentPage />},
      { path: '/order/pay/:pay',element: <OrderPaymentPage />},
      { path: '/order/pay/first/:pay',element: <SuccessFirstPage />},
      { path: '/order/pay/second/:pay',element: <SuccessSecondPage />},
      { path: '/order/pay/third/:pay',element: <SuccessThirdPage />},
      { path: '/order/pay/success/:id',element: <OrderSuccessPage />},
      { path: '/myorder/topay',element: <OrderToPay />},
      { path: '/myorder/all',element: <AllOrders />},
      { path: '/myorder/aftersale',element: <OrderAfterSale />},
      { path: '/myorder/toreceive',element: <OrderToReceive />},
      { path: '*', element: <Error /> },
    ],
  },
];

export default routesConfig;
